#ifndef __PHLOGGER_LINUX_H__
#define __PHLOGGER_LINUX_H__

#pragma warning(disable: 4996)
#pragma warning(disable: 4995)

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <stdarg.h>

#ifndef _vscprintf
	#define _vscprintf(a,b) 10240
#endif //_vscprintf


#ifndef DISENABLE_LOGGER
#include "flogger.h"
#endif

#ifndef DISENABLE_LOGGER
  #define SetLogPath flogger::GetInitance().Path
	#define OpenLogger flogger::GetInitance().open
	#define SetLogFlag flogger::GetInitance().Flag
	#define LoadFromCFG flogger::GetInitance().loadcfg
  #define SetMaxSize flogger::GetInitance().MaxSize
  #define SetFileMaxCount flogger::GetInitance().SetFileMaxCount
  #define EnableLogger flogger::GetInitance().enable_logger
	#define SetLogSpliter flogger::GetInitance().Split
	#define SetEnableRealTimeOutput flogger::GetInitance().SetEnableRealTimeOutput
	inline void SetLoggerPipe(const char*){}
	inline void CloseLoggerPipe(){}

#ifdef _WRITE_LOG_TO_CONSOLE
	#define WriteLog flogger::GetInitance().write_log_console
#else
  #ifdef WIN32
    #define WriteLog(evt, format, ...) do{ flogger::GetInitance().write_log(evt, __FILE__, __FUNCTION__, __LINE__, format, __VA_ARGS__); \
      }while(0)
  #else
    #define WriteLog flogger::GetInitance().write_log
  #endif
#endif

#else //DISENABLE_LOGGER
	inline void OpenLogger(const char*){}
	inline void SetLogPath(const char*){}
	inline void SetLogFlag(int){}
	inline void SetLogSpliter( char ){}
	inline void EnableLogger(bool ){}
	inline void WriteLog(...){}
	inline void SetLoggerPipe(const char*){}
	inline void CloseLoggerPipe(){}
  inline void SetMaxSize(unsigned long) {}
  inline void SetEnableRealTimeOutput(bool) {}
#endif //DISENABLE_LOGGER

	
#endif //__PHLOGGER_H__
